home *** CD-ROM | disk | FTP | other *** search
/ Die Speccy' 97 / Die Speccy' 97.iso / amiga_system / the_aminet / util / rexx / tritonrexx376.lha / TritonRexx / Rexx / GadgetDemo.rexx < prev    next >
OS/2 REXX Batch file  |  1995-09-16  |  8KB  |  246 lines

  1. /*
  2. ** $VER: TritonRexx Gadget-Demo 1.0 (2.8.95)
  3. */
  4.  
  5. /*
  6. ** Library mit *erh÷hter* *PrioritΣt* einbinden! Wenn noch andere
  7. ** Libraries eingebunden sind wird dies die Arbeitsgeschwindigkeit
  8. ** des Scripts positiv beeinflussen, da die 'tritonrexx.library'
  9. ** dann wegen ihrer PrioritΣt immer als erstes nach Funktionen
  10. ** durchsucht wird.
  11. */
  12.  
  13. IF ~SHOW('LIBRARIES','tritonrexx.library') THEN DO
  14.    IF ~ADDLIB('tritonrexx.library',10,-30,0) THEN DO
  15.       SAY 'Kann die <tritonrexx.library> nicht ÷ffnen!'
  16.       EXIT(10)
  17.    END
  18. END
  19.  
  20.  
  21.  
  22. /*
  23. ** EintrΣge fⁿr das Cycle-Gadget
  24. */
  25.  
  26. cyclelist.0 = 3
  27. cyclelist.1 = 'Hallo'
  28. cyclelist.2 = 'Moin'
  29. cyclelist.3 = 'Tach'
  30.  
  31.  
  32. /*
  33. ** EintrΣge fⁿr das MX-Gadget
  34. */
  35.  
  36. mxlist.0 = 6
  37. mxlist.1 = 'Amiga 500'
  38. mxlist.2 = 'Amiga 600'
  39. mxlist.3 = 'Amiga 1200'
  40. mxlist.4 = 'Amiga 2000'
  41. mxlist.5 = 'Amiga 3000'
  42. mxlist.6 = 'Amiga 4000'
  43.  
  44.  
  45. /*
  46. ** Definitionen
  47. */
  48.  
  49. apptags =      'TRCA_Name     Gadgets',
  50.                'TRCA_LongName "TritonRexx Gadget-Demo"',
  51.                'TRCA_Info     "Verschiedene Gadgets auf einen Blick!"',
  52.                'TRCA_Version  "1.0"',
  53.                'TRCA_Release  "1"',
  54.                'TRCA_Date     "1.8.95"',
  55.                'TAG_END'
  56.  
  57. windowtags =   WindowID(1),
  58.                WindowPosition('TRWP_CENTERDISPLAY'),
  59.                WindowTitle("Gadgets"),
  60.                   'HorizGroupAC',
  61.                      'Space',
  62.                      'VertGroupA',
  63.                         'Space',
  64.                         NamedSeparator('Gadget deaktivieren'),
  65.                         'Space',
  66.                         Button('_Button',1),
  67.                         'Space',
  68.                         'HorizGroupSC',
  69.                            'Space',
  70.                            'HorizGroup',
  71.                               TextID('_Knopf aktiv?',2),
  72.                               'Space',
  73.                               CheckBoxCLEFT(2),
  74.                            'EndGroup',
  75.                            'Space',
  76.                         'EndGroup',
  77.                         'SpaceB',
  78.                         NamedSeparator('Werte anzeigen'),
  79.                         'Space',
  80.                         'LineArray',
  81.                            'BeginLine',
  82.                               TextID('Sc_roller',3) 'TRAT_Flags TROF_RIGHTALIGN',
  83.                               'Space',
  84.                               'TROB_Scroller TROF_HORIZ TRSC_Total 40 TRSC_Visible 10 TRAT_Value 5 TRAT_ID 3',
  85.                               'Space',
  86.                               ClippedTextBoxMW(5,30,2),
  87.                            'EndLine',
  88.                            'Space',
  89.                            'BeginLine',
  90.                               TextID('S_lider',4) 'TRAT_Flags TROF_RIGHTALIGN',
  91.                               'Space',
  92.                               SliderGadget(1,50,25,4),
  93.                               'Space',
  94.                               ClippedTextBoxMW(25,40,2),
  95.                            'EndLine',
  96.                            'Space',
  97.                            'BeginLine',
  98.                               TextID('C_ycle',5) 'TRAT_Flags TROF_RIGHTALIGN',
  99.                               'Space',
  100.                               CycleGadget('cyclelist',0,5),
  101.                               'Space',
  102.                               ClippedTextBoxMW(cyclelist.1,50,5),
  103.                            'EndLine',
  104.                         'EndArray',
  105.                         'SpaceB',
  106.                          NamedSeparator('Text eingeben'),
  107.                         'Space',
  108.                         'LineArray',
  109.                            'BeginLine',
  110.                               TextID('_String',6) 'TRAT_Flags TROF_RIGHTALIGN',
  111.                               'Space',
  112.                               StringGadget('Bitte Σndern',6),
  113.                               GetEntryButton(60),
  114.                            'EndLine',
  115.                            'Space',
  116.                            'BeginLine',
  117.                               TextID('_Password',7) 'TRAT_Flags TROF_RIGHTALIGN',
  118.                               'Space',
  119.                               PasswordGadget('',7),
  120.                            'EndLine',
  121.                         'EndArray',
  122.                         'Space',
  123.                      'EndGroup',
  124.                      'Space',
  125.                      'VertSeparator',
  126.                      'Space',
  127.                      'VertGroupAC',
  128.                         'Space',
  129.                         NamedSeparatorI('Aus_wahl',8),
  130.                         'Space',
  131.                         MXGadget('mxlist',4,8),
  132.                         'Space',
  133.                         ClippedTextBox(mxlist.5,80),
  134.                         'SpaceB',
  135.                         NamedSeparatorI('D_oppelklick!',9),
  136.                         'Space',
  137.                         ListSS('mxlist',9,0,4),
  138.                      'EndGroup',
  139.                      'Space',
  140.                   'EndGroup',
  141.                'EndProject'
  142.  
  143.  
  144. /*
  145. ** Unterbrechungssignale
  146. */
  147.  
  148. SIGNAL ON break_c
  149. SIGNAL ON failure
  150. SIGNAL ON halt
  151. SIGNAL ON ioerr
  152. SIGNAL ON syntax
  153.  
  154.  
  155. /*
  156. ** Fenster ÷ffnen und auswerten
  157. */
  158.  
  159. app = TR_CREATEAPP(apptags)
  160.  
  161. IF app ~= '00000000'x THEN DO
  162.    window = TR_OPENPROJECT(app,windowtags)
  163.  
  164.    IF window ~= '00000000'x THEN DO
  165.       ende = 0
  166.  
  167.       DO WHILE ~ende
  168.          CALL TR_WAIT(app,'')
  169.  
  170.          DO WHILE TR_HANDLEMSG(app,'event')
  171.             IF event.trm_class = 'TRMS_NEWVALUE' THEN DO
  172.                SELECT
  173.                   WHEN event.trm_id = 2 THEN
  174.                      CALL TR_SETATTRIBUTE(window,1,'TRAT_Disabled',~event.trm_data)
  175.  
  176.                   WHEN event.trm_id = 3 THEN
  177.                      CALL TR_SETATTRIBUTE(window,30,'TRAT_Text',event.trm_data)
  178.  
  179.                   WHEN event.trm_id = 4 THEN
  180.                      CALL TR_SETATTRIBUTE(window,40,'TRAT_Text',event.trm_data)
  181.  
  182.                   WHEN event.trm_id = 5 THEN DO
  183.                      nummer = event.trm_data+1
  184.                      CALL TR_SETATTRIBUTE(window,50,'TRAT_Text',cyclelist.nummer)
  185.                   END
  186.  
  187.                   WHEN event.trm_id = 8 THEN DO
  188.                      nummer = event.trm_data+1
  189.                      CALL TR_SETATTRIBUTE(window,80,'TRAT_Text',mxlist.nummer)
  190.                   END
  191.  
  192.                   WHEN event.trm_id = 9 THEN DO
  193.                      IF BITAND(D2X(event.trm_qualifier),'0200'x) = '0200'x THEN DO
  194.                         nummer = event.trm_data
  195.                         CALL TR_SETATTRIBUTE(window,8,'TRAT_Value',nummer)
  196.  
  197.                         nummer = nummer+1
  198.                         CALL TR_SETATTRIBUTE(window,80,'TRAT_Text',mxlist.nummer)
  199.                      END
  200.                   END
  201.  
  202.                   OTHERWISE
  203.                      NOP
  204.                END
  205.             END
  206.  
  207.             IF event.trm_class = 'TRMS_ACTION' THEN DO
  208.                IF event.trm_id = 60 THEN DO
  209.                   string = TR_GETATTRIBUTE(window,6,'TROB_String')
  210.                   CALL TR_EASYREQUEST(app,'Inhalt des Eingabefeldes:'||'0a'x||string,'_Aha','TREZ_LockProject' C2D(window) 'TAG_END')
  211.                END
  212.                ELSE
  213.                   CALL TR_EASYREQUEST(app,'Knopf betΣtigt, ID:' event.trm_id,'_Aha','TREZ_LockProject' C2D(window) 'TAG_END')
  214.             END
  215.  
  216.             IF event.trm_class = 'TRMS_CLOSEWINDOW' THEN
  217.                ende = 1
  218.          END
  219.       END
  220.  
  221.       CALL TR_CLOSEPROJECT(window)
  222.    END
  223.  
  224.    CALL TR_DELETEAPP(app)
  225. END
  226.  
  227. EXIT(0)
  228.  
  229.  
  230. /*******************************************************************************
  231. ** Routine, die bei einer Unterbrechung des Scripts aufgerufen wird
  232. *******************************************************************************/
  233.  
  234. break_c:
  235. failure:
  236. halt:
  237. ioerr:
  238. syntax:
  239.    SAY '+++ Fehler' rc 'in Zeile' sigl '-' ERRORTEXT(rc)
  240.    SAY SOURCELINE(sigl)
  241.  
  242.    IF app ~= '00000000'x THEN
  243.       CALL TR_DELETEAPP(app)
  244.  
  245.    EXIT(10)
  246.